home *** CD-ROM | disk | FTP | other *** search
/ Mac Expert 1995 Winter / Mac Expert - Winter 95.iso / Les fichiers / Tidbits / Tidbits 01 à 100 / TidBITS#099_Finder_Fun.txt < prev    next >
Encoding:
Text File  |  1995-06-19  |  15.8 KB  |  380 lines  |  [TEXT/ttxt]

  1. TidBITS#99/Finder_Fun
  2. =====================
  3.  
  4.   Copyright 1990-1992 Adam & Tonya Engst. Non-profit, non-commercial
  5.    publications may reprint articles if full credit is given. Other
  6.    publications please contact us. We do not guarantee the accuracy
  7.    of articles. Publication, product, and company names may be
  8.    registered trademarks of their companies. Disk subscriptions and
  9.    back issues are available.
  10.  
  11.  For more information send electronic mail to info@tidbits.uucp or
  12.  Internet: ace@tidbits.uucp -- CIS: 72511,306 -- AOL: Adam Engst
  13.  TidBITS -- 9301 Avondale Rd. NE Q1096 -- Redmond, WA 98052 USA
  14.  -----------------------------------------------------------------
  15.  
  16. Topics:
  17.     Fun with the Finder
  18.     Finder Command Keys
  19.     The fmnu Template
  20.     Quit the Finder
  21.     Zoom Animation
  22.     Free Size Display
  23.     Rename Delay
  24.     Application Substitution
  25.  
  26.  
  27. Fun with the Finder
  28. -------------------
  29.   Virtually every article ever written about ResEdit warns you to
  30.   always work on a copy and to keep backups and so on. This warning
  31.   has become somewhat cliche, but we're going to do it anyway: only
  32.   work on a copy of the file and keep backups. We recommend always
  33.   using the latest version of ResEdit since Apple does make
  34.   significant improvements to each new version. As of the
  35.   publication date, the latest version we've seen is 2.1.1. With all
  36.   of these procedures for modifying the Finder, you'll have to drag
  37.   the original out of the System Folder, drag your modified copy
  38.   into the System Folder, and reboot before any changes will take
  39.   effect. Finally, ResEdit is not for the timorous. Because of that,
  40.   we have not taken a hand-holding approach to the directions, so if
  41.   you have no idea what the directions mean, feel free to
  42.   experiment, but make sure that you're working on a copy and that
  43.   you don't throw the original Finder out until you have determined
  44.   that your copy works fine. 'Nuff said.
  45.  
  46.   We should note that there are several shareware utilities that
  47.   will do some of this dirty work for you. Check out the System 7
  48.   Pack from Adam Stein for application substitution, rename delay
  49.   editing, and adding command keys to the Finder. FileEdit (soon to
  50.   be called FinderEdit) can add substitute applications, and the
  51.   freeware extension UnderStudy can do the same, although UnderStudy
  52.   requires the use of ResEdit to configure your substitutions.
  53.   Connectix makes the most powerful utility in this arena, Hand-Off
  54.   II, which can not only substitute different applications for
  55.   standard document formats but goes one further by allowing you to
  56.   substitute (for example) Nisus for all documents that have been
  57.   created by Word, no matter what type (TEXT, WDBN, etc.) those
  58.   files may have. Finally, a small application called Anti-Finder
  59.   can quit the Finder and then launch it again.
  60.  
  61.   In a bit, the tricks, but first a note from Eric, who contributed
  62.   much of this issue and a bunch of tips on System 7 for a
  63.   forthcoming issue. "The following are various tricks I've come
  64.   across. If you have any questions drop me a line. These are my
  65.   tips, not Apple's!"
  66.  
  67.   Information from:
  68.     Eric Apgar -- apgar@apple.com
  69.     Robert Hess -- ENDPOINT@applelink.apple.com
  70.     Adam C. Engst -- ace@tidbits.halcyon.com
  71.     Trey Campbell -- FLC3527@tamxrd.tamu.edu
  72.     Russ Arcuri -- raa92@137.238.1.1
  73.  
  74.  
  75. Finder Command Keys
  76. -------------------
  77.   If you don't have an fmnu template (see below) and you want to
  78.   change or add a command key to a menu item, you have to poke
  79.   around until you find the text of the menu item's name (e.g.
  80.   "Empty Trash") and then change the byte that is three bytes before
  81.   the first letter of the item's name to the command key. Maybe an
  82.   example would help - to use Command-T to "Empty Trash", open fmnu
  83.   #1255 (ResEdit opens fmnu resources as generic resources unless
  84.   you have an fmnu template, see below), and change byte number 2C
  85.   to "T" or $54. Byte number 2C is three bytes before the "E" in
  86.   "Empty Trash" at byte number 2F. Like most things with ResEdit,
  87.   this isn't for the faint of heart, and for all I know it may have
  88.   some disastrous consequences. But it works for me, and I haven't
  89.   noticed any side effects.
  90.  
  91.  
  92. The fmnu Template
  93. -----------------
  94.   The System 7 Finder has been completely rewritten in C++, so none
  95.   of the old ways to customize the Finder with ResEdit work anymore.
  96.   There are, however, a couple of things you can do with ResEdit in
  97.   the new Finder, too. The menus are stored in resources of type
  98.   fmnu (they include quite a bit more information than would fit in
  99.   the regular MENU resource type) and here is how you can create a
  100.   template to edit them. (ADAM: If you're busy like me or lazy, you
  101.   won't want to do this. Therefore, I'm including a copy of the fmnu
  102.   template with this issue. Just open it with ResEdit, open the
  103.   ResEdit Preferences file in the Preferences folder in your System
  104.   Folder, copy the fmnu resource, and paste it into the ResEdit
  105.   Preferences file. Close both and enjoy!) Use ResEdit (preferably
  106.   2.1.1, but it should work with older versions) to modify the
  107.   ResEdit Preferences file by adding a new resource of type TMPL.
  108.   Create 15 new fields in the list and enter the following values
  109.   for "Label" and "Type":
  110.  
  111.  Label         Type     Comment
  112.  Visible       DWRD     1=Menu is visible in Menubar; 0=invisible
  113.  Item Count    DWRD     the number of items in the menu plus 1
  114.  ???           DWRD     ???
  115.  Menu Number   DWRD     the resource ID of the fmnu
  116.  ???           DWRD     ???
  117.  ???           DWRD     ???
  118.  Title         ESTR     title of menu (padded to an even length)
  119.  *****         LSTB     begin of item list
  120.  AppleEvent    TNAM     corresponding AppleEvent for this item
  121.  ???           DBYT     ???
  122.  ???           DBYT     ???
  123.  Cmd Key       CHAR     keyboard equivalent of command
  124.  ???           DBYT     ???
  125.  Item Text     ESTR     text of item
  126.  *****         LSTE     end of item list
  127.  
  128.   Please note, that a "???" indicates that I simply don't know what
  129.   these fields contain (maybe they will one day be documented by
  130.   Apple). Once you've entered this list, close the TMPL resource
  131.   you've just created and change its name to fmnu using the Get
  132.   Resource Info... command. Finally close and save the ResEdit
  133.   Preferences file. You can now edit the Finder's menus and do other
  134.   neat things.
  135.  
  136.   While the above technique actually gives you the same freedom of
  137.   customization that you already had in the System 6 days, you can
  138.   do a lot more with the new fmnu resources:
  139.  
  140.   For instance, the fmnu resource type is not position-dependent
  141.   anymore! This means that you can actually completely rearrange the
  142.   menus in the Finder. All you need to do is make sure that you copy
  143.   all the information stored in the various fields of an item to its
  144.   new destination (copy and paste can be a lot of help here!). You
  145.   can even create your own menu and move commands from other menus
  146.   to the new one!
  147.  
  148.  
  149. Quit the Finder
  150. ---------------
  151.   Sometimes it's nice to quit the Finder. This frees up a little bit
  152.   of memory (not as much as you would think) but, even better, it
  153.   lets you edit the Finder or rebuild your desktop without rebooting
  154.   (you can hold down the Command and Option keys when the Finder
  155.   restarts and it rebuilds the desktop). Remember: when you quit the
  156.   Finder you lose the Apple Menu's items and the use of Background
  157.   Printing. After you quit the Finder, you can start it with a
  158.   utility that launches other applications (assuming that it's a
  159.   utility that recognizes the Finder as a program that can be
  160.   launched) or by quitting all running applications.
  161.  
  162.   Open a copy of your Finder in ResEdit and open the fmnu resources.
  163.  
  164.   Each one of the fmnu resources is a Finder menu. Here are the more
  165.   important menus:
  166.  
  167.  1251: Apple
  168.  1252: File
  169.  1253: Edit
  170.  1254: View
  171.  1255: Special
  172.  1256: Label
  173.  90125: Chez Oui (just kidding)
  174.  
  175.   (The others are, for the most part, menus that appear elsewhere in
  176.   the Finder, like in the "Find" dialog box.)
  177.  
  178.   Assuming that you want to add "Quit" to the Special menu (though
  179.   this works for adding "Quit" to any menu), open fmnu #1255. If all
  180.   you see is a bunch of hexadecimal code, you need to install the
  181.   fmnu template we just discussed. Stop here until you get the fmnu
  182.   template installed. If you see:
  183.  
  184.  Visible
  185.  Item Count
  186.  ???
  187.  
  188.   etc., then you're ready to go. (Good hacker. <pat pat>) Now scroll
  189.   down to the bottom of the dialog box. You should see:
  190.  
  191.  9) *****
  192.  
  193.   Click on the "*****". A box should appear around it. Go to the
  194.   "Resource" menu and select "Insert New Field(s)". A new, blank set
  195.   of fields should appear below the "9) *****" followed by a new
  196.   "10) *****". Fill in the fields above the "10) *****" like this:
  197.   (Those are zeros, not the letter "o" below.)
  198.  
  199.  AppleEvent     xxx0
  200.  ???            0
  201.  ???            0
  202.  Cmd Key        (leave this one blank)
  203.  ???            0
  204.  Item Text      - (a minus sign)
  205.  
  206.   That will create a divider bar. Now click on the "10) *****" and
  207.   select Insert New Resource(s) again. Now you have a "11) *****".
  208.   Fill in #11 like this:
  209.  
  210.  AppleEvent     quit (EXACTLY 'quit' - lowercase is important)
  211.  ???            -127
  212.  ???            0
  213.  Cmd Key        Q (you may leave this blank; see below)
  214.  ???            0
  215.  Item Text      Quit
  216.  
  217.   You may leave the "Cmd Key" section blank. This is (surprise) what
  218.   command key you want this menu item to have. I like Command-Q for
  219.   "Quit". Some people find this inconvenient since it's easy to
  220.   accidentally quit the Finder if you have such a key. That's up to
  221.   you; quitting the Finder is no big deal since it may easily be
  222.   launched again (by quitting all running applications or by
  223.   launching it with a utility such as PowerStrip, as I mentioned
  224.   above).
  225.  
  226.   Now go up to the top of the window and make sure that the field
  227.   that says "Item Count" has "11" next to it. If it doesn't, change
  228.   it.
  229.  
  230.   Quit ResEdit, saving your changes. You're done!
  231.  
  232.   Using this technique, you may rearrange menus anyway you like. You
  233.   could, for example, move the "Find" commands to the "Edit" menu
  234.   simply by moving their 2 items from one fmnu to another. The
  235.   System 7 Finder doesn't care where things are. You could, in fact,
  236.   remove all menus from the Finder except the Apple but that would
  237.   be stupid.
  238.  
  239.  
  240. Zoom Animation
  241. --------------
  242.   When the Finder opens or closes an item, it shows an animation
  243.   effect usually called the "ZoomRect" (zooming rectangles describes
  244.   it pretty well, so that's what those innovative programmers called
  245.   the procedure). When you open or close a lot of items, especially
  246.   on a slow Mac, this effect is suddenly renamed "damnSlowZoomRect".
  247.   Here's how to remove the effect:
  248.  
  249.  1) Open a copy of the Finder with ResEdit 2.1.1
  250.  2) Open the Code resource
  251.  3) Open Code ID 4 (Yup, you need to decompress it)
  252.  4) Find hex 4E56 FFE0 48E7 1F38
  253.  5) Select these bytes
  254.  6) Replace with 205F 700A DEC0 4ED0
  255.  7) Save the copy of the Finder and close ResEdit.
  256.  
  257.  
  258. Free Size Display
  259. -----------------
  260.   When the amount of free space in the Finder is more than one
  261.   megabyte, the Finder displays the free space in megabytes. I like
  262.   it to keep displaying in K. This will force the Finder to display
  263.   always in "K", not "M".
  264.  
  265.   Launch ResEdit and open your copy of the Finder. Open the CODE
  266.   resources. Click once on resource number 23. Go to the "Resource"
  267.   menu and select "Open Using Hex Editor..." (don't double-click on
  268.   it since you might have a fancy CODE template installed in your
  269.   ResEdit, which would make the next step possibly impossible [don't
  270.   tell my old English teacher that I said that]). Click Yes if it
  271.   asks if you want to decompress the resource.
  272.  
  273. Use "Find Offset..." to go to offset 18E. You should see
  274.     0C86 0010 0000 6500 0082. If you don't, don't continue.
  275.  
  276. Change the 6500 to 6000. That is, change:
  277.     0C86 0010 0000 6500 0082   to:
  278.     0C86 0010 0000 6000 0082
  279.  
  280.   Quit ResEdit, saving your changes. All this patch does is change a
  281.   conditional branch to an unconditional one. In other words,
  282.   whereas the Finder used to say, "If the amount of space available
  283.   is more than one meg, display in M; otherwise, display in K," it
  284.   now says, "If the amount of space available is more than one meg,
  285.   uhm, display in K." Trust me; it really says that. Listen closely
  286.   next time.
  287.  
  288.  
  289. Rename Delay
  290. ------------
  291.   The rename delay is tied to the setting for double-click speed in
  292.   the Mouse Control Panel. The slower the double-click speed, the
  293.   longer you wait for the Finder to enter edit mode after you click
  294.   on a file name. However, if you hit the Return or Enter key after
  295.   clicking on a name, you enter edit mode immediately (this is
  296.   included for those who don't want to change their Finder). If you
  297.   do, read on.
  298.  
  299.   Use ResEdit to open CODE resource 11. At offset A28, you will find
  300.   the value E388. You can substitute the following values to reduce
  301.   the delay time:
  302.  
  303.  1/2 normal delay, use 4E71
  304.  1/4 normal delay, use E288
  305.  1/8 normal delay, use E488.
  306.  
  307.   Having changed the value here, you are still tied to the double-
  308.   click speed. Other values are possible, but a better alternative
  309.   may be to eliminate the delay completely. You can do this by going
  310.   to offset A5A, where you will find the value 5DC0, and replacing
  311.   it with 50C0. I've been using the latter patch myself for several
  312.   weeks now without any apparent side effects.
  313.  
  314.  
  315. Application Substitution
  316. ------------------------
  317.   One of the new features in Finder 7 is that it can substitute one
  318.   application for another, assuming the second application can open
  319.   the first one's documents. This is why the Finder will try to open
  320.   TEXT files and PICT files in TeachText if it can't find the
  321.   original application. You can add your own substitutions (ADAM: I
  322.   personally have all TEXT files, Word files, and MacWrite files
  323.   open in Nisus, which is much handier than keeping copies of
  324.   everything else around.).
  325.  
  326.   First, make a copy of the Finder, as ResEdit won't allow you to
  327.   work on the currently active Finder. Launch ResEdit and open the
  328.   copied Finder. Next double-click on the fmap resource. Now open
  329.   resource # 17010. You will see a window with hexadecimal code on
  330.   the left and garbled text on the right. The text on the right
  331.   should read:
  332.  
  333.     TEXTttxt
  334.     PICTttxt
  335.     00000000
  336.  
  337.   The last line is actually a line of rectangles, not zeros. Select
  338.   the entire line of rectangles, and choose Copy from the Edit menu.
  339.   Then, without deselecting the line of rectangles, choose Paste
  340.   from the Edit menu. Nothing much should happen. Now choose Paste
  341.   again, and you should end up with a second line of rectangles
  342.   under the first, so that the whole thing looks like this:
  343.  
  344.     TEXTttxt
  345.     PICTttxt
  346.     00000000
  347.     00000000
  348.  
  349.   Now, select the entire first line of rectangles, and type in the
  350.   document type and creator that you want that document opened with.
  351.   For example, if you want all MacWrite documents to be opened by
  352.   Microsoft Word, you would type "WORDMSWD" so that when you are
  353.   done, the text looks like this:
  354.  
  355.     TEXTttxt
  356.     PICTttxt
  357.     WORDMSWD
  358.     00000000
  359.  
  360.   Now close the fmap #17010 window, the fmap window, and the Finder
  361.   window.
  362.  
  363.   Click Yes when ResEdit asks you if you want to save changes. Quit
  364.   ResEdit, move the currently active Finder out of the System
  365.   Folder, and rename the "Finder copy" to "Finder." Reboot the
  366.   machine, and from now on when you double click on a MacWrite
  367.   document, the Finder will ask you if you would like to open it
  368.   with Microsoft Word. Other combinations can be added to the Finder
  369.   using the same method of replacing those eight rectangles (non-
  370.   printing characters) with the four character type of the document
  371.   and then the four character creator of the application you wish to
  372.   use instead of the original one.
  373.  
  374.  
  375. ..
  376.  
  377.  This text is encoded in the setext format. Please send email to
  378.  <info@tidbits.uucp> or contact us at one of the above addresses
  379.  to learn how to get more information on the setext format.
  380.